
template <typename T>
class Singleton {
public:
    static T& GetInstance() {
        static T instance;  // C++11 保证静态局部变量初始化线程安全
        return instance;
    }
    
    // 禁用拷贝和移动
    Singleton(const Singleton&) = delete;
    Singleton& operator=(const Singleton&) = delete;
private:
    Singleton() = default;
    ~Singleton() = default;
};